<?php
/* SVN FILE: $Id: add.ctp 14 2009-09-27 01:09:01Z kenreily@gmail.com $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * Recenseo: Online submission and reviewing for education
 * Copyright 2008-2009, Ken Reily
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * $Date: 2009-09-27 01:09:01 +0000 (Sun, 27 Sep 2009) $
 * $Revision: 14 $
 * $Author: kenreily@gmail.com $
 * $HeadURL: http://recenseo.googlecode.com/svn/trunk/app/views/submissions/add.ctp $
 */

  if (count($assignment_info) > 0)
  {
?>
<dl>
  <dt>Course</dt>
  <dd><?php echo $html->link($assignment_info[0]['c']['name'],'/assignments/index/' . $assignment_info[0]['c']['id']); ?></dd>
  
  <dt>Assignment</dt>
  <dd><?php echo $assignment_info[0]['a']['name']; ?></dd>
  
  <dt>Due</dt>
  <dd><?php echo $time->nice($assignment_info[0]['a']['due']); ?></dd>
  
  <dt>Cutoff</dt>
  <dd><?php echo $time->nice($assignment_info[0]['a']['cutoff']); ?></dd>

  <dt>Flex Days</dt>
  <dd><?php echo $flex_days_required; ?> required (<?php echo $flex_days_remaining; ?> remaining) </dd>
  
<?php
  if ($deduction > 0)
  {
?>  
  <dt>Deduction</dt>
  <dd><?php echo $deduction . '%'; ?></dd>
<?php
  }
?>
</dl>
<?php
    echo $form->create('Submission',array('type' => 'file', 'action' => '/add/' . $assignment_id));

    if (!empty($this->data))
    {    
      echo $form->input('Submission.file_name',
        array('disabled' => true));
    }

    echo $form->input('Submission.grading_option_id',array('empty' => '(choose one)'));
    
    echo $form->input('File',
      array('type' => 'file', 
        'label' => 'ZIP File',
        'after' => '<p><small>(Only ZIP files will be accepted)</small></p>'));
    
    echo $form->input('Submission.comments',
      array('label' => 'Comments (will be seen by course staff and peer reviewers):',
        'after' => '<p><small>(Please do not include any personally identifiable information, such as your name or student ID)</small></p>'));

    echo $form->input('Submission.hours_est',
      array('label' => 'For course improvement purposes, please estimate the number of hours you spent on this assignment:',
        'maxLength' => 2));

    echo $form->end('Submit Assignment');
  }
  else
  {
?>
<p>Assignment not found.</p>
<?php 
  }
?>